 <%@ page language="java" contentType="text/html; charset=UTF-8" 
    pageEncoding="UTF-8"%> 
<%
  String xm = this.getServletContext().getInitParameter("path");
	String path1 = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/"+xm;
%>  
    
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head> 
    <title> 
      
    </title> 
<link rel="stylesheet" href="<%=path1 %>/qt/ycss/bootstrap.min.css">

<!-- 可选的Bootstrap主题文件（一般不用引入） -->
<link rel="stylesheet" href="<%=path1 %>/qt/ycss/bootstrap-theme.min.css">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="<%=path1 %>/qt/yjs/jquery.min.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="<%=path1 %>/qt/yjs/bootstrap.min.js"></script>
      
<script type="text/javascript" src="<%=path1 %>/scripts/jquery-1.7.2.js"></script> 
<script type="text/javascript" src="<%=path1 %>/scripts/pagekage/utils/widget/jqGrid/jquery.jqGrid.src.js"></script>
<script type="text/javascript" src="<%=path1 %>/scripts/pagekage/utils/widget/jqGrid/i18n/grid.locale-cn.js"></script>
<script type="text/javascript" src="<%=path1 %>/scripts/pagekage/utils/widget/jqGrid/jquery.jqGrid.min.js"></script>
 <script type="text/javascript">
//添加
    function ajaxPost1(){
      $.ajax({ 	
        data:{
        	role_id:$("#id123").val(),
            name:$("#name").val(),
        	tel:$("#tel").val(),
        	jueshi:$("#jueshi").val(),
        	jigou:$("#jigou").val(),
        	update_user:$("#update_user").val(),
        	update_time:$("#update_time").val(),
        	delete_user:$("#delete_user").val(),
        	delete_time:$("#delete_time").val(),
        	delete_state:$("#delete_state").val()
        	
        },
        	
        type:"Post",  
        dataType: 'json',  
        url:"../role/addRole.do", 
        error:function(data){ 
        //	alert(data);
             alert("出错了！！");  
        },  
        success:function(data){
        //	alert(data);
        	alert('角色添加成功！');
        	window.location.href = 'listrole.jsp'; 
         }  
         });  
     } 


    $(document).ready(function(){
	 $.ajax({ 	
	        type:"Post",  
	        dataType: 'json',  
	        url:"http://localhost:8080/wanda_java2/role/selectRoleAll.do", 
	        error:function(data){ 
	        //	alert(data);	 
	             alert("出错了！！");  
	        },  
	        success:function(data){
	        //	alert(data);
	        	//alert(data.rows[0].menu_name);
	        	
	        	 var sel= document.getElementById("jueshi"); 
	             sel.options.add(new Option("请选择",""));
	        
	             jQuery.each(data.rows, function(i,item){ 
	           	  
	              sel.options.add(new Option(item.role_name,item.role_id));
	      		    
	             });
	        	
	         }  
	         }); 
    }); 

    $(document).ready(function(){
   	 $.ajax({ 	
   	        type:"Post",  
   	        dataType: 'json',  
   	        url:"http://localhost:8080/wanda_java2/qt/Organization/selectAll.do", 
   	        error:function(data){ 
   	        //	alert(data);	 
   	             alert("出错了！！");  
   	        },  
   	        success:function(data){
   	        //	alert(data);
   	        	//alert(data.rows[0].menu_name);
   	        	
   	        	 var sel= document.getElementById("jigou"); 
   	             sel.options.add(new Option("请选择",""));	        
   	             jQuery.each(data.rows, function(i,item){ 
   	              sel.options.add(new Option(item.organization_name,item.organization_id));
   	      		    
   	             });
   	        	
   	         }  
   	         }); 
       }); 


</script>
</head>    
<body>  

<form action="../addUser">
<div style="width: 600px; margin-left:auto; margin-right:auto;">
<div class="form-group has-success">
  <label class="control-label" for="inputSuccess1"></label>
  用户：<input type="text" class="form-control" name="name" id="name" placeholder="用户名称" />
</div>
<div class="form-group has-success">
  <label class="control-label" for="inputSuccess1"></label>
  密码 ：<input type="password" class="form-control" name="mima" id="mima" placeholder="密码" />
</div>
<div class="form-group has-success">
  <label class="control-label" for="inputSuccess1"></label>
  电话：<input type="text" class="form-control" name="tel" id="tel" placeholder="电话" />
</div>
 角色：<select class="form-control" name="jueshi" id="jueshi">
    </select>
 机构：<select class="form-control" name="jigou" id="jigou">
</select>



</br>
   　　　　　　    <input type="submit" value="　提　交"  class="btn btn-success"/>
   　　　　　　　 <input type="button" value="　取　消"  class="btn btn-success"/>
　　　　　　　　
　　　　　　　　
</div>
</form>


   
</body>
</html>
    